package com.source.baseData.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.source.baseData.entity.PoultryCategoryParent;
import com.source.baseData.mapper.PoultryCategoryParentMapper;
import com.source.baseData.service.PoultryCategoryParentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Joey
 * @since 2021-02-22
 */
@Service
public class PoultryCategoryParentServiceImpl extends ServiceImpl<PoultryCategoryParentMapper, PoultryCategoryParent> implements PoultryCategoryParentService {

    @Autowired
    PoultryCategoryParentMapper parentMapper;

    @Override
    public IPage<PoultryCategoryParent> findAllOnPagination(Page<PoultryCategoryParent> page) {
        return parentMapper.findAllOnPagination(page);
    }

    @Override
    public String findNameById(String id) {
        return parentMapper.findNameById(id);
    }

    @Override
    public List<PoultryCategoryParent> findByKeyWord(String keyWord) {
        return parentMapper.findByKeyWord("%"+keyWord+"%");
    }
}
